package com.google.api.chart;

public final class MarginMaker {

	public static MarginMaker margin() {
		return new MarginMaker();
	}
	private int left = 0;
	private int right = 0;
	private int top = 0;
	private int bottom = 0;
	private String legendOptional = null;
	
	private MarginMaker() {
	}
	
	@Override
	public String toString() {
		return left + "," + right + "," + top + "," + bottom + (legendOptional != null ? legendOptional : "");
	}

	public MarginMaker left(int pixels) {
		this.left = pixels;
		return this;
	}
	public MarginMaker right(int pixels) {
		this.right = pixels;
		return this;
	}
	public MarginMaker top(int pixels) {
		this.top = pixels;
		return this;
	}
	public MarginMaker bottom(int pixels) {
		this.bottom = pixels;
		return this;
	}
	public MarginMaker legendSize(int widthPixels, int heightPixels) {
		this.legendOptional  = "|" + widthPixels + "," + heightPixels;
		return this;
	}
}
